﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Diploma.Models.CollaborationRoom>" %>
<%@ Import Namespace="ViewRes" %>

<div style="border-top: 1px solid #EEEEEE; padding: 5px 0 0 0;">

    <%
        Html.RenderPartial("~/Views/CollaborationRooms/ThemeControl.ascx", Model, ViewData);%>
    <ul style="text-align: right; list-style: none outside none; margin: 5px;">
    <%
        if (Model.Student == null)
        {%>      
        <%
            if (((Student) ViewData["LoggedUser"]).CollaborationPropos == null || (((Student)ViewData["LoggedUser"]).CollaborationPropos.DeletionDate) != null)
            {%>
            <li style="display: inline;"><span> <%--<%:ViewRes.CollaborationRooms.Decline %>    --%>       
            <a href='<%:Url.RouteUrl("Default",
                                               new
                                                   {
                                                       controller = "Students",
                                                       action = "ParticipateRoom",
                                                       id = Model.CollaborationRoomId
                                                   })%>'>
                <img title='<%:CollaborationRooms.Take%> ' src="<%:Url.Content("~/Content/Icons/smaller_footprint.png")%>" class='mediumIcon' />
            </a>
        </span></li>
        <li style="display: inline;"><span>
            <a href='<%:Url.RouteUrl("Default",
                                               new
                                                   {
                                                       controller = "Students",
                                                       action = "Propose",
                                                       id = Model.CollaborationRoomId
                                                   })%>'>
                <img title='<%:CollaborationRooms.ProposeTheme%>'  src="<%:Url.Content("~/Content/Icons/propose.png")%>" class='mediumIcon' />
           </a>
        </span></li>
        <%
            } %>
        <%
            else if (((Student) ViewData["LoggedUser"]).CollaborationPropos.CollaborationRoom == Model)
            {%>        
          <li style="display: inline;"><span>
            <img title='<%:CollaborationRooms.ExpectAnswer%> '  src="<%:Url.Content("~/Content/Icons/waiting.png")%>" 
                class='mediumIcon' />
        </span></li>
        <li style="display: inline;"><span>
            <a href='<%:Url.RouteUrl("Default",
                                               new
                                                   {
                                                       controller = "CollaborationRooms",
                                                       action = "RefuseRoom",
                                                       id = Model.CollaborationRoomId
                                                   })%>'>
         
             <img title='<%:CollaborationRooms.Decline%>'  src="<%:Url.Content("~/Content/Icons/stop_icon.png")%>" class='mediumIcon' />
         
           </a>
        </span></li>
       <%
            }%>
    <%
        } %>
    <%
        else if (Model.Student.UserId == ((Student) ViewData["LoggedUser"]).UserId)
        {%>
      <li style="display: inline;"><span>
            <img title = '<%: CollaborationRooms.YourTheme %>' src="<%:Url.Content("~/Content/Icons/green_flag.png")%>" 
                class='mediumIcon' />
        </span></li>
         <li style="display: inline;"><span>
            <%--<a href='<%:Url.RouteUrl("Default",
                                           new
                                               {
                                                   controller = "CollaborationRooms",
                                                   action = "RefuseRoom",
                                                   id = Model.CollaborationRoomId
                                               })%>'>
              <%  if (((Student)ViewData["LoggedUser"]).CollaborationPropos.IsApproved)
                  { %>
                <img title='<%:CollaborationRooms.Decline%>'  src="<%:Url.Content("~/Content/Icons/stop_icon.png")%>" class='mediumIcon' />
            <%} %>
            </a>--%>
        </span></li>
    <%
        } %>
    <%
        else
        {%>
        <span class="smallgreentext"><%:Model.Student.ToString()%> <%:CollaborationRooms.TookTheme%>   <%:Model.Student.CollaborationPropos.DateTime.ToString()%></span>
    <%
        }%>       
    </ul>

</div>
